Release 10.1A: OpenEdge Development:
Programming Interfaces
Progress SAX callbacks
When the XML parser encounters an XML token, Progress invokes the callback corresponding to that token — if that callback is provided by the developer. If not, the parser continues.
Progress SAX implements callbacks as internal procedures coded by the 4GL SAX developer using signatures specified by Progress. Normally, callbacks are placed in a procedure (
Note: Although there are many callbacks in the SAX2 interface, most applications use just a few. These are.p) file that the application runs persistently. But callbacks can also be placed in the driver routine. A driver routine is one that calls theSAX-PARSE()orSAX-PARSE-FIRST()method. In whichever procedure callbacks are placed, the application assigns that procedure’s handle to theSAX-reader’sHANDLERattribute. (HANDLERdefaults to a handle to the driver routine). Then, the application starts the parse.StartElement,Characters, andEndElement.Within a callback, to get a handle to the
SAX-readerobject that invoked the callback, use theSELFsystem handle.The following fragment uses
SELFwithin a callback to call theSAX-reader’sSTOP-PARSING()method:
The following fragment uses
SELFwithin a callback to store data in theSAX-reader’sPRIVATE-DATAattribute:
For information on the SAX parser’s current location in the XML source, use the following attributes of
SAX-reader:Table 20–2 summarizes the callbacks. For complete descriptions, see the "SAX callback reference" section.
Table 20–2: SAX callback summary This callback... Lets you... Tell the parser where to find an external entity. Process various XML tokens. Process notations and unparsed entities. Handle errors.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |